Automated Template Generation Algorithm for Implantable Device

ABSTRACT

A method of generating a template in an implantable medical device for implantation within a patient, and a processor readable medium for performing the method, that includes generating a template from collected events corresponding to the patient, delaying the generation of the template for a first predetermined time period in response to the template not being generated within a predetermined number of collected events, determining whether the template is valid, and monitoring the template to determine whether the template is an accurate representation of the patient.

RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.10/132,773, entitled “AUTOMATED TEMPLATE GENERATION ALGORITHM FORIMPLANTABLE DEVICE,” now allowed, which claims priority to U.S.Provisional Patent Application Ser. No. 60/286,467, filed Apr. 25, 2001,entitled “AUTOMATED TEMPLATE GENERATION ALGORITHM FOR IMPLANTABLE ICD”,incorporated herein by reference in its entirety.

Cross-reference is hereby made to U.S. Provisional Patent ApplicationSer. No. 60/253,555, filed Nov. 28, 2000, entitled “AUTOMATED TEMPLATEGENERATION ALGORITHM FOR IMPLANTABLE ICD”, now U.S. PublishedApplication No. 2002/0087091, filed Nov. 26, 2001, entitled “AUTOMATEDTEMPLATE GENERATION ALGORITHM FOR IMPLANTABLE DEVICE”.

FIELD OF THE INVENTION

The present invention relates generally to a physiological waveformmorphology discrimination method for use in an implantable medicaldevice, and in particular, the present invention relates to automaticcreation of a template for EGM morphology measurements in an implantablemedical device.

BACKGROUND OF THE INVENTION

In the medical fields of cardiology and electrophysiology, many toolsare used to assess the condition and function of a patient's heart,including the observed frequency, polarity and amplitudes of the PQRSTcomplex associated with a heart cycle. Such tools include classicexternal ECG systems for displaying and recording the characteristiclead ECG signals from skin electrodes placed on the patient's chest andlimbs, ambulatory ECG Holter monitors for continuously recording the ECGor segments thereof from a more limited set of skin electrodes for aperiod of time, and more recently developed completely implantablecardiac monitors or cardiac pacemakers andpacemaker/cardioverter/defibrillators (PCDs) or implantablecardioverter/defibrillators (ICDs) having the capability of recordingEGM segments or data derived from atrial and ventricular EGMS (A-EGMsand V-EGMs) for telemetry out to an external programmer for externalstorage and display.

One of the problems addressed in the design of implantable PCDs or ICDsis the avoidance of unnecessary electrical shocks delivered to apatient's heart in response to rapid heart rates caused by exercise(sinus tachycardia) or by atrial fibrillation. Such rhythms are knowncollectively as supraventricular tachycardias (SVTs). Studies have shownthat SVTs may occur in up to 30% of ICD patients. While ICDs aregenerally effective at identifying ventricular tachycardia events, theICD can occasionally deliver a therapy to treat what is detected asbeing a ventricular tachycardia when in fact the source of the event isrelated to a supraventricular tachycardia event. Since delivery of thetreatment is painful and disconcerting to the patient, deficiencies indistinguishing ventricular tachycardia events from supraventriculartachycardia events tends to be problematic, making the reduction of theincidences of inappropriate treatment highly desirable.

One approach to the problem of distinguishing between normal QRScomplexes present during SVTs from those indicative of a VT is to studythe morphology of the QRS complex and discriminate normal heart beatsfrom abnormal ones based on the similarity of the signal to a samplewaveform recorded from the normal heartbeat, typically referred to as atemplate. Since a normal QRS complex, or slow rate rhythm, is generallynarrower than the QRS complex during VT, or fast rate rhythm, one of theexisting methods to discriminate between VT and normal EGM waveforms isbased on the properly measured width of the QRS complex. By creating thetemplate based on information sensed from supraventricular rhythmcomplexes, the ICD is able to compare cardiac complexes sensed duringtachycardia episodes against the supraventricular rhythm template. Basedon the results of the comparison, the ICD is able to classify thetachycardia episodes as being either a VT complex or a SVT complex, anddelivers therapy according to the classification.

In theory, the shape of the QRS complex in the EGM signal during SVTwill not change significantly in most patients, because ventriculardepolarizations are caused by normal HIS-Purkinje conduction from theatrium to the ventricle. If high ventricular rates are due to aventricular tachycardia (VT), one can expect a very different morphologyof the electrogram (EGM) signal of the ventricular depolarization (QRScomplex) because of a different pattern of electrical activity of theheart during VT. However, in certain instances, such as during theelectrode/tissue maturation process, or when the patient begins takingnew or additional medications, develops a myocardial infarction, orexperiences other physiological changes causing the electrical tissue ofthe patient to change, the morphology of the normal heart rhythm of thepatient may change from that originally used as a basis for creating thetemplate. As a result, since deviation from the “normal” heart rhythm ofthe patient occurs, the template begins to become corrupted, no longerbeing representative of the patient's current normal heart rhythm andtherefore causing the number of inappropriately delivered therapies toincrease.

In addition to reducing delivery of inappropriate therapy, another majorconsideration to be taken into account in the development of the ICD isthe limited battery power of the ICD that is available. Since thebatteries supplied in the ICD cannot be replaced after initialimplantation of the device without surgical procedures, the entire ICDmust typically be surgically replaced once the batteries becomedepleted, making it very desirable to conserve battery power of the ICD.As a result, one of the ways to conserve battery power is to reduce thecurrent drain by reducing the complexity of the signal processing thatmust be performed by the ICD, limiting the available solutions toreduction of inappropriate therapy delivery. Accordingly, what is neededis a method for reducing the instances of inappropriate therapy deliverythat maximizes conservation of the battery power of the device.

SUMMARY OF THE INVENTION

The present invention relates to a method of generating a template in animplantable medical device for implantation within a patient, and aprocessor readable medium for performing the method, that includesgenerating a template from collected events corresponding to thepatient, delaying generation of the template for a first predeterminedtime period in response to the template not being generated within apredetermined number of collected events, determining whether thetemplate is valid, and monitoring the template to determine whether thetemplate is an accurate representation of the patient.

According to a preferred embodiment of the present invention, the stepof generating a template includes monitoring a heart rate of the patientto generate the collected events, determining whether beatscorresponding to the collected events are normal beats, and determiningwhether a predetermined number of normal beats has been collected withinthe predetermined number of collected events, wherein the step ofdelaying the template generation includes delaying the templategeneration in response to the predetermined number of normal beats notbeing collected within the predetermined number of collected events.

According to another aspect of the present invention, the step ofgenerating a template includes determining whether the predeterminednumber of normal beats have been collected and computing cross matchesbetween the predetermined number of collected normal beats to formcorresponding computed cross matches, determining whether apredetermined number of the computed cross matches exceed a threshold,determining whether a predetermined number of cross matching attemptshave failed, delaying the template generation for a second predeterminedtime period in response to the predetermined number of failed crossmatching attempts, and forming the template from the predeterminednumber of computed cross matches in response to the predetermined numberof the computed cross matches exceeding the threshold.

According to yet another aspect of the present invention, the step ofdetermining whether the template is valid includes collecting subsequentnormal beats within a second predetermined time period, computing amatch between the subsequently collected normal beats and the template,determining whether the match is within a predetermined threshold toform matched beats and other than matched beats, determining whether theother than matched beats is greater than a first number of beats, anddetermining the template is valid in response to the matched beats beinggreater than or equal to a second number of beats.

According to still another aspect of the present invention, the step ofmonitoring the template includes, in response to a predetermined numberof subsequent beats being other than matched beats, determining whetheran average degree of similarity between the other than matched beats andthe template is less than a predetermined threshold, deleting thetemplate in response to the average degree of similarity between theother than matched beats and the template being less than thepredetermined threshold, and generating a template in response to theaverage degree of similarity between the other than matched beats andthe template being greater than or equal to the predetermined threshold.

BRIEF DESCRIPTION OF THE DRAWINGS

The features of the present invention which are believed to be novel areset forth with particularity in the appended claims. The invention,together with further objects and advantages thereof, may best beunderstood by making reference to the following description, taken inconjunction with the accompanying drawings, in the several figures ofwhich like reference numerals identify like elements, and wherein:

FIG. 1 illustrates an implantable medical device and its associated leadsystem, as implanted in and adjacent to the heart.

FIG. 2 is a functional schematic diagram of an implantable medicaldevice in which the present invention may usefully be practiced.

FIG. 3 is a flowchart of generation of a template for an implantablemedical device according to the present invention.

FIG. 3A is a flowchart of generation of a template for an implantablemedical device according to an alternate embodiment of the presentinvention.

FIG. 4 is a flowchart of generation of a template for an implantablemedical device according to the present invention.

FIG. 5 is a flowchart of generation of a template for an implantablemedical device according to an alternate preferred embodiment of thepresent invention.

FIG. 6 is a flowchart of statistical validation of a template for animplantable medical device according to an alternate preferredembodiment of the present invention.

FIG. 7 is a flowchart of monitoring of template quality for animplantable medical device according to the present invention.

FIG. 8 is a flowchart of monitoring of template quality for animplantable medical device according to an alternate embodiment of thepresent invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 is a schematic diagram of an implantable medical device forutilizing the template generation according to the present invention. Asillustrated in FIG. 1, an implantable medical device 100, such as apacemaker/cardioverter/defibrillator includes a lead system having acoronary sinus lead 110, a right ventricular lead 120, and asubcutaneous lead (not shown). Coronary sinus lead 110 is provided withan elongated electrode located in the coronary sinus and great veinregion at 112, extending around the heart until approximately the pointat which the great vein turns downward toward the apex of the heart.Right ventricular lead 120 includes two elongated defibrillationelectrodes 122 and 128, a ring electrode 124, and helical electrode 126,which is screwed into the tissue of the right ventricle at the rightventricular apex. A housing 102 of defibrillator 100 may serve as anadditional electrode.

In conjunction with the present invention, the lead system illustratedprovides electrodes that may be used to detect electrical activity inthe ventricles. For example, ring electrode 124 and tip electrode 126may be used to detect the occurrence of an R-wave and ring electrode 124and a subcutaneous defibrillation electrode (not shown) may be used toprovide an EGM signal stored in response to R-wave detect.Alternatively, electrodes 124 and 126 may be used for both R-wavedetection and as a source for the stored digitized EGM signal used formorphology analysis. According to a preferred embodiment of the presentinvention, electrodes 122 and 102 are utilized for morphology analysis.Other electrode configurations may also be employed. In alternativeembodiments in which atrial depolarizations are of interest, sensingelectrodes would correspondingly be placed in or adjacent the patientsatria.

FIG. 2 is a functional schematic diagram of an implantable medicaldevice in which the present invention may usefully be practiced. Thisdiagram should be taken as exemplary of the type of device in which theinvention may be embodied, and not as limiting, as it is believed thatthe invention may usefully be practiced in a wide variety of deviceimplementations, including devices having functional organizationsimilar to any of the implantable pacemaker/cardioverter/defibrillatorspresently being implanted for clinical evaluation in the United States.The invention is also believed practicable in conjunction withimplantable pacemaker/cardioverters/defibrillators as disclosed in priorU.S. Pat. No. 4,548,209, issued to Wielders, et al. on Oct. 22, 1985,U.S. Pat. No. 4,693,253, issued to Adams et al. on Sep. 15, 1987, U.S.Pat. No. 4,830,006, issued to Haluska et al. on May 6, 1989 and U.S.Pat. No. 4,949,730, issued to Pless et al. on Aug. 21, 1990, all ofwhich are incorporated herein by reference in their entireties.

The device is illustrated as being provided with six electrodes, 500,502, 504, 506, 508 and 510. Electrodes 500 and 502 may be a pair ofelectrodes located in the ventricle, for example, corresponding toelectrodes 124 and 126 in FIG. 1. Electrode 504 may correspond to aremote, electrode located on the housing of the implantablepacemaker/cardioverter/defibrillator. Electrodes 506, 508 and 510 maycorrespond to the large surface area defibrillation electrodes locatedon the ventricular and coronary sinus leads illustrated in FIG. 1 or toepicardial or subcutaneous defibrillation electrodes.

Electrodes 500 and 502 are shown as hard-wired to the R-wave detectorcircuit which includes a band pass amplifier 514, an auto-thresholdcircuit 516 for providing an adjustable sensing threshold as a functionof the measured R-wave amplitude and a comparator 518. A signal isgenerated on R-out line 564 whenever the signal sensed betweenelectrodes 500 and 502 exceeds the present sensing threshold defined byauto threshold circuit 516. As illustrated, the gain on the band passamplifier 514 is also adjustable by means of a signal from the pacertiming/control circuitry 520 on GAIN ADJ line 566.

The operation of this R-wave detection circuitry may correspond to thatdisclosed in U.S. Pat. No. 5,117,824 by Keimel, et al., issued Jun. 2,1992, incorporated herein by reference in its entirety. However,alternative R-wave detection circuitry such as that illustrated in U.S.Pat. No. 4,819,643, issued to Menken on Apr. 11, 1989 and U.S. Pat. No.4,880,004, issued to Baker et al. on Nov. 14, 1989, both incorporatedherein by reference in their entireties, may also usefully be employedto practice the present invention.

Threshold adjustment circuit 516 sets a threshold corresponding to apredetermined percentage of the amplitude of a sensed R-wave, with thethreshold decaying to a minimum threshold level over a period of lessthan three seconds thereafter, similar to the automatic sensingthreshold circuitry illustrated in the article “Reliable R-WaveDetection from Ambulatory Subjects”, by Thakor et al., published inBiomedical Science Instrumentation, Vol. 4, pp 67-72, 1978, incorporatedherein by reference in its entirety. An improved version of such anamplifier is disclosed in U.S. patent application Ser. No. 09/250,065,filed Feb. 12, 1999 by Rajasekhar, et al., for an “Implantable Devicewith Automatic Sensing Adjustment”, also incorporated herein byreference in its entirety. The invention may also be practiced inconjunction with more traditional R-wave sensors of the type comprisinga band pass amplifier and a comparator circuit to determine when theband-passed signal exceeds a predetermined, fixed sensing threshold.

Switch matrix 512 is used to select which of the available electrodesmake up the second electrode pair for use in conjunction with thepresent invention. The second electrode pair may include electrode 502or 500 in conjunction with electrode 504, 506, 508 or 510, or mayinclude other combinations of the illustrated electrodes, includingcombinations of the large surface defibrillation electrodes 506, 508,510. Selection of which two electrodes are employed as the secondelectrode pair in conjunction with R-wave width measurement function iscontrolled by the microprocessor 524 via data/address bus 540. Signalsfrom the selected electrodes are passed through band-pass amplifier 534and into multiplexer 532, where they are converted to multi-bit digitalsignals by A/D converter 530, for storage in random access memory 526under control of direct memory address circuit 528. Microprocessor 524employs the digitized EGM signal stored in random access memory 526 inconjunction with the morphology analysis method utilized. For example,the microprocessor 524 may analyze the EGM stored in an intervalextending from 100 milliseconds previous to the occurrence of an R-wavedetect signal on line 564, until 100 milliseconds following theoccurrence of the R-wave detect signal. Alternatively, microprocessormay 524 may analyze the width of the patient's R-wave to generate thetemplate, as described, for example, in U.S. Pat. No. 5,312,441, issuedto Mader et al. on May 17, 1994, and incorporated herein by reference init's entirety. The operation of microprocessor 524 in performing thetemplate generation method of the present invention is controlled bymeans of software stored in ROM, associated with microprocessor 524.

The remainder of the circuitry is dedicated to the provision of cardiacpacing, cardioversion and defibrillation therapies. Pacer timing/controlcircuitry 520 includes programmable digital counters which control thebasic time intervals associated with VVI mode cardiac pacing, includingthe pacing escape intervals, the refractory periods during which sensedR-waves are ineffective to restart timing of the escape intervals andthe pulse width of the pacing pulses. The durations of these intervalsare determined by microprocessor 524, and are communicated to pacingcircuitry 520 via address/data bus 540. Pacer timing/control circuitry520 also determines the amplitude of the cardiac pacing pulses and thegain of band-pass amplifier, under control of microprocessor 524.

During VVI mode pacing, the escape interval counter within pacertiming/control circuitry 520 is reset upon sensing of an R-wave asindicated by a signal on line 564, and on timeout triggers generation ofa pacing pulse by pacer output circuitry 522, which is coupled toelectrodes 500 and 502. The escape interval counter is also reset ongeneration of a pacing pulse, and thereby controls the basic timing ofcardiac pacing functions, including anti-tachycardia pacing. Theduration of the interval defined by the escape interval timer isdetermined by microprocessor 524, via data/address bus 540. The value ofthe count present in the escape interval counter when reset by sensedR-waves may be used to measure the duration of R-R intervals, to detectthe presence of tachycardia and to determine whether the minimum ratecriteria are met for activation of the width measurement function.

Microprocessor 524 operates as an interrupt driven device, under controlof software stored in the ROM associated with microprocessor 524 andresponds to interrupts from pacer timing/control circuitry 520corresponding to the occurrence of sensed R-waves and corresponding tothe generation of cardiac pacing pulses. These interrupts are providedvia data/address bus 540. Any necessary mathematical calculations to beperformed by microprocessor 524 and any updating of the values orintervals controlled by pacer timing/control circuitry 520 take placefollowing such interrupts. These calculations include those described inmore detail below associated with the discrimination methods of thepresent invention.

In the event that a tachycardia is detected, and an anti-tachycardiapacing regimen is desired, appropriate timing intervals for controllinggeneration of antitachycardia pacing therapies are loaded frommicroprocessor 524 into pacer timing/control circuitry 520, to controlthe operation of the escape interval counter and to define refractoryperiods during which detection of an R-wave by the R-wave detectioncircuitry is ineffective to restart the escape interval counter.Similarly, in the event that generation of a cardioversion ordefibrillation pulse is required, microprocessor 524 employs thecounters to in pacer timing/control circuitry 520 to control timing ofsuch cardioversion and defibrillation pulses, as well as timing ofassociated refractory periods during which sensed R-waves areineffective to reset the timing circuitry.

In response to the detection of fibrillation or a tachycardia requiringa cardioversion pulse, microprocessor 524 activatescardioversion/defibrillation control circuitry 554, which initiatescharging of the high voltage capacitors 556, 558, 560 and 562 viacharging circuit 550, under control of high voltage charging line 552.The voltage on the high voltage capacitors is monitored via VCAP line538, which is passed through multiplexer 532, and, in response toreaching a predetermined value set by microprocessor 524, results ingeneration of a logic signal on CAP FULL line 542, terminating charging.Thereafter, delivery of the timing of the defibrillation orcardioversion pulse is controlled by pacer timing/control circuitry 520.One embodiment of an appropriate system for delivery and synchronizationof cardioversion and defibrillation pulses, and controlling the timingfunctions related to them is disclosed in more detail in U.S. Pat. No.5,188,105, issued to Keimel on Feb. 23, 1993 and incorporated herein byreference in its entirety. However, any known cardioversion ordefibrillation pulse generation circuitry is believed usable inconjunction with the present invention. For example, circuitrycontrolling the timing and generation of cardioversion anddefibrillation pulses as disclosed in U.S. Pat. No. 4,384,585, issued toZipes on May 24, 1983, in U.S. Pat. No. 4949719 issued to Pless et al.,cited above, and in U.S. Pat. No. 4,375,817, issued to Engle et al., allincorporated herein by reference in their entireties may also beemployed. Similarly, known circuitry for controlling the timing andgeneration of antitachycardia pacing pulses as described in U.S. Pat.No. 4,577,633, issued to Berkovits et al. on Mar. 25, 1986, U.S. Pat.No. 4,880,005, issued to Pless et al. on Nov. 14, 1989, U.S. Pat. No.7,726,380, issued to Vollmann et al. on Feb. 23, 1988 and U.S. Pat. No.4,587,970, issued to Holley et al. on May 13, 1986, all of which areincorporated herein by reference in their entireties may also be used.

In modern pacemaker/cardioverter/defibrillators, the particularantitachycardia and defibrillation therapies are programmed into thedevice ahead of time by the physician, and a menu of therapies istypically provided. For example, on initial detection of tachycardia, ananti-tachycardia pacing therapy may be selected. On redetection oftachycardia, a more aggressive anti-tachycardia pacing therapy may bescheduled. If repeated attempts at anti-tachycardia pacing therapiesfail, a higher-level cardioversion pulse therapy may be selectedthereafter. Prior art patents illustrating such pre-set therapy menus ofanti-tachyarrhythmia therapies include the above-cited U.S. Pat. No.4,830,006, issued to Haluska, et al., U.S. Pat. No. 4,727,380, issued toVollmann et al. and U.S. Pat. No. 4,587,970, issued to Holley et al. Thepresent invention is believed practicable in conjunction with any of theknown anti-tachycardia pacing and cardioversion therapies, and it isbelieved most likely that the invention of the present application willbe practiced in conjunction with a device in which the choice and orderof delivered therapies is programmable by the physician, as in currentim plantable pacemaker/card ioverter/defibrillators.

In the present invention, selection of the particular electrodeconfiguration for delivery of the cardioversion or defibrillation pulsesis controlled via output circuit 548, under control ofcardioversion/defibrillation control circuitry 554 via control bus 546.Output circuit 548 determines which of the high voltage electrodes 506,508 and 510 will be employed in delivering the defibrillation orcardioversion pulse regimen, and may also be used to specify amultielectrode, simultaneous pulse regimen or a multi-electrodesequential pulse regimen. Monophasic or biphasic pulses may begenerated. One example of circuitry which may be used to perform thisfunction is set forth in U.S. Pat. No. 5,163,427, issued to Keimel onNov. 17, 1992, incorporated herein by reference in its entirety.However, output control circuitry as disclosed in U.S. Pat. No.4,953,551, issued to Mehra et al. on Sep. 4, 1990 or U.S. Pat. No.4,800,883, issued to Winstrom on Jan. 31, 1989 both incorporated hereinby reference in their entireties, may also be used in the context of thepresent invention. Alternatively single monophasic pulse regimensemploying only a single electrode pair according to any of theabove-cited references that disclose implantable cardioverters ordefibrillators may also be used.

As discussed above, switch matrix 512 selects which of the variouselectrodes are coupled to band pass amplifier 534. Amplifier 534 may bea band-pass amplifier, having a band pass extending for approximately2.5 to 100 hertz. The filtered EGM signal from amplifier 534 is passedthrough multiplexer 532, and digitized in A-D converter circuitry 530.The digitized EGM data is stored in random access memory 526 undercontrol of direct memory address circuitry 528. Preferably, a portion ofrandom access memory 526 is configured as a looping or buffer memory,which stores at least the preceding several seconds of the EGM signal.

The occurrence of an R-wave detect signal on line 564 is communicated tomicroprocessor 524 via data/address bus 540, and microprocessor 524notes the time of its occurrence. If the morphology analysis function isactivated, microprocessor 524 may, for example, wait 100 milliseconds orother physician selected interval following the occurrence of the R-wavedetect signal, and thereafter transfer the most recent 200 millisecondsor other physician selected interval of digitized EGM stored in thelooping or buffer memory portion of the random access memory circuit 526to a second memory location, where the contents may be digitallyanalyzed according to the present invention. In this case, thetransferred 200 milliseconds of stored EGM will correspond to a timewindow extending 100 milliseconds on either side of the R-wave detectsignal. Window sizes in any case should be sufficient to allow analysisof the entire QRS complexes associated with the detected R-waves. Themicroprocessor also updates software-defined counters that holdinformation regarding the R-R intervals previously sensed. The countersare incremented on the occurrence of a measured R-R intervals fallingwithin associated rate ranges. These rate ranges may be defined by theprogramming stored in the RAM 526

The following exemplary VTVF detection method corresponds to thatemployed in commercially marketed Medtronic implantablepacemaker/cardioverter/defibrillators and employs rate/interval basedtiming criteria as a basic mechanism for detecting the presence of atachyarrhythmia. To this end, the device defines a set of rate rangesand associated software-defined counters to track the numbers ofintervals falling within the defined ranges.

A first rate range may define a minimum R-R interval used forfibrillation detection, referred to as “FDI”. The associated VF countpreferably indicates how many of a first predetermined number of thepreceding R-R intervals were less than FDI.

A second rate range may include R-R intervals less than a lowertachycardia interval “TDI”, and the associated VT count (VTEC) isincremented in response to an R-R interval less than TDI but greaterthen FDI, is not affected by R-R intervals less than FDI, and is resetin response to R-R intervals greater than TDI.

Optionally, the device may include a third rate range including R-Rintervals greater than the FDI interval, but less than a fasttachycardia interval (FTDI) which is intermediate the lower tachycardiainterval (TDI) and the lower fibrillation interval (FDI).

For purposes of the present example, the counts may be used to signaldetection of an associated arrhythmia (ventricular fibrillation, fastventricular tachycardia or lower rate ventricular tachycardia) when theyindividually or in combination reach a predetermined value, referred toherein as “NID's” (number of intervals required for detection). Eachrate zone may have its own defined count and NID, for example “VFNID”for fibrillation detection and “VTNID” for ventricular tachycardiadetection or combined counts may be employed. These counts, along withother stored information reflective of the previous series of R-Rintervals such as information regarding the rapidity of onset of thedetected short R-R intervals, the stability of the detected R-Rintervals, the duration of continued detection of short R-R intervals,the average R-R interval duration and information derived from analysisof stored EGM segments are used to determine whether tachyarrhythmia arepresent and to distinguish between different types of tachyarrhythmia.For purposes of illustrating the invention, an exemplary rate/intervalbased ventricular tachyarrhythmia detection method is described above.Other tachyarrhythmia detection methodologies, including detectionmethods as described in U.S. Pat. No. 5,991,656, issued to Olson, et al.on Nov. 23, 1999, U.S. Pat. No. 5,755,736, issued to Gillberg, et al. onMay 26, 1998, both incorporated herein by reference in their entireties,or other known ventricular and/or atrial tachyarrhythmia detectionmethods may be substituted. It is believed that the discriminationmethods of the present invention may be usefully practiced inconjunction with virtually any underlying atrial or ventriculartachyarrhythmia detection scheme. Other exemplary detection schemes aredescribed in U.S. Pat. No. 4,726,380, issued to Vollmann, U.S. Pat. No.4,880,005, issued to Pless et al., U.S. Pat. No. 4,830,006, issued toHaluska et al., and U.S. patent application Ser. No. 09/566,477, filedMay 8, 2000 by Gillberg et al., all incorporated by reference in theirentireties herein. An additional set of tachycardia recognitionmethodologies is disclosed in the article “Onset and Stability forVentricular Tachyarrhythmia Detection in an ImplantablePacer-Cardioverter-Defibrillator” by Olson et al., published inComputers in Cardiology, Oct. 7-10, 1986, IEEE Computer Society Press,pages 167-170, also incorporated by reference in its entirety herein.However, other criteria may also be measured and employed in conjunctionwith the present invention.

FIG. 3 is a flowchart of generation of a template for an implantablemedical device according to the present invention. As illustrated inFIGS. 2 and 3, generation of a supraventricular rhythm templateaccording to the present invention is initiated by microprocessor 524,either automatically or manually at Step 160, using R-waves of thedigitized EGM signals stored in random access memory 526. The generationof the template is initiated, for example, when no template currentlyexists, or upon recognition, either automatically by the implantablemedical device, or manually by a physician, that the current template isno longer accurate, as will be described below. Once the automatictemplate generation process is initiated in Step 160, and a template iscreated, Step 162, a determination is then made as to whether thecreated template is valid, Steps 164 and 166. If it is determined thatthe template is not valid, No in Step 166, the template is discarded andthe process returns to step 160 to create a new template. However, if itis determined that the template is valid, YES in Step 166, the templateis copied in a permanent position for VT/SVT discrimination, Step 168.According to the present invention, once created, the quality of thevalid template continues to be monitored, Step 170, and a determinationis made in Step 172 as to whether the template continues to be a validtemplate, i.e., whether the template is an accurate representation of asupraventricular rhythm of the patient. If it is determined in Steps 170and 172 that the template is no longer valid, No in Step 172, theprocess returns to step 160 to create a new template. Once the newtemplate is created and validated in Steps 162-166, the new template iscopied in the permanent position, Step 168, replacing the previoustemplate, and the quality of the new template is monitored, Steps 170and 172. On the other hand, if it is determined that the template isvalid, i.e., that the template continues to be an accuraterepresentation of a supraventricular rhythm of the patient, YES in Step172, the device continues to monitor the template quality, Step 170, andso on.

FIG. 3A is a flowchart of generation of a template for an implantablemedical device according to an alternate embodiment of the presentinvention. As illustrated in FIG. 3A, an alternate embodiment of thepresent invention is similar to the template generation described abovein reference to FIG. 3, and therefore description of Steps 160-172 isomitted merely for brevity sake. However, the alternate embodiment ofFIG. 3A differs from the embodiment described above in reference to FIG.3 in that once it is determined that the template is no longer valid inSteps 170 and 172, a determination is then made as to whether thetemplate currently copied in the permanent position should be deleted,Step 173, based on the results of the monitored quality of the beats inStep 170, prior to returning to Step 160 to create a new template. Ifthe results of the monitored quality beats is within a predeterminedthreshold, NO in Step 173, the process returns to Step 160 to create anew template. However, if the results of the monitored quality beats isnot within the predetermined threshold, YES in Step 173, the templatecurrently copied in the permanent position should is deleted, Step 175,and the process returns to Step 160 to create a new template.

FIG. 4 is a flowchart of generation of a template for an implantablemedical device according to the present invention. As illustrated inFIGS. 2 and 4, a process for generation of a supraventricular rhythmtemplate according to the present invention is initiated bymicroprocessor 524, either automatically or manually, using R-waves ofthe digitized EGM signals stored in random access memory 526 at regularintervals. The template generation process is initiated, for example,when no template currently exists, or upon recognition, eitherautomatically by the implantable medical device, or manually by aphysician, that the current template is no longer accurate, as will bedescribed below. Upon initiation of the automatic template generationprocess, microprocessor 524 sets counters corresponding to the number ofbeats collected, the matched beats collected, and the average R-wave tozero, Step 200 and begins monitoring the heart rate of the patient, Step202.

Microprocessor 524 next determines whether a beat is a normal beat bydetermining whether the beat is a paced beat, a beat immediatelyfollowing a paced beat, or has an R-R interval less than 600 ms, Step204. If the beat is determined to be a paced beat or to have an R_Rinterval below 600 ms in Step 204, and therefore not a normal beat, adetermination is made as to whether a predetermined time period has beenexceeded, Step 206, so that if the amount of time required to collectthe number of normal beats required to create the template exceeds apredetermined threshold, the template generation process will be abortedand the VT/SVT discrimination algorithm utilizing EGM morphology may beset to PASSIVE mode (if there is a template already created within thedevice) or to OFF mode, and attempts to create a new template will berepeated after a predetermined time period has expired.

If the beat is determined to be a normal beat, i.e., the beat is neithera paced beat, a beat immediately following a paced beat, or has an R-Rinterval less than 600 ms, a determination is made as to whether apredetermined number of normal beats have been collected, Step 208. Forexample, according to a preferred embodiment of the present invention, adetermination is made in Step 208 as to whether six beats have beencollected. It is understood, however, that the number of beats chosenfor the predetermined number of beats used in Step 208 is merely amatter of design choice that may be programmed within the device, andtherefore the present invention is not intended to be limited to the useof six beats in Step 208.

If it is determined in Step 208 that the predetermined number of normalbeats has not been collected, a determination is then made as to whethera predetermined number of events, i.e., paced beats, a beat immediatelyfollowing a paced beat, beats having R-R intervals less than 600 ms, andnormal beats, for example, have been collected, Step 203. For example,according to a preferred embodiment of the present invention, adetermination is made in Step 203 as to whether 64 events have beencollected, although it is understood that the present invention is notlimited to the use of 64 events. If the predetermined number of eventshave not been collected, the process continues by examining the nextbeat, Step 202. On the other hand, if the predetermined number of normalbeats have not been collected, NO in Step 208, and the predeterminednumber of events have been collected, YES in Step 203, microprocessor524 determines that the predetermined number of normal beats, i.e., sixfor example, have not been obtained within a predetermined window, i.e.,within 64 events. As a result, if the predetermined number of normalbeats have not been collected within a predetermined number of collectedevents, microprocessor 524 delays further attempts at creating atemplate for a predetermined period of time, Step 205, delayingmonitoring of the heart rate of the patient, and as a result, reducingcurrent drain. For example, according to the present invention, currentconsumption is reduced by delaying generation of the template forapproximately ten minutes, although it is understood that thepredetermined delay is programmable and the present invention is notintended to be limited to a ten minute delay. Once the predetermineddelay is completed, microprocessor 524 clears the predetermined numberof collected events, i.e., the 64 events, Step 207, and once againbegins monitoring the heart rate of the patient, Step 202.

In this way, according to the present invention, the process ofgenerating the template continues until the predetermined number sixnormal beats have been collected, but is delayed for a predeterminedperiod of time if the predetermined number of normal beats is notreceived within the predetermined number of collected events. Once thesix normal beats are collected within the predetermined window,microprocessor 524 computes cross matches between the collected normalbeats, Step 210. For example, according to the present invention, thefirst beat is matched against the second through sixth beats to generatefive cross matches. A determination is then made as to whether four ormore of the computed cross matches are similar within a predeterminedthreshold, Step 212. For example, according to a preferred embodiment ofthe present invention, the predetermined threshold of Step 212 isnominally 70%, although any value could be chosen without deviating fromthe present invention.

If four or more of the computed cross matches are not similar within thepredetermined threshold, a determination is made as to whether apredetermined time period, such as one hour for example, or apredetermined number of attempts, such as three for example, has beenexceeded, Step 206, so that if the amount of time required to collectthe number of cross matches required to create the template exceeds apredetermined threshold, the template generation process will be abortedand attempts to create a new template will be repeated after apredetermined time period has expired. In particular, according to apreferred embodiment of the present invention, each time it isdetermined in Step 212 that four or more of the of the computed crossmatches are not similar within the predetermined threshold, adetermination is made as to whether a predetermined number of attemptsat cross matching have failed to provided the number of similar computedcross matches required in Step 212, and if so, the process is delayedfor a predetermined time period, resulting in reduced current drain onthe device 100. For example, according to a preferred embodiment of thepresent invention, if it is determined in Step 206 that the crossmatching threshold has not been reached within four attempts, theprocess is delayed for approximately 156 minutes, although the presentinvention is not intended to be limited to four failed cross matchingattempts or to a delay of 156 minutes, but is intended to include anynumber of failed cross matching attempts and/time period that would beconsidered to be appropriate. However, if it is determined in Step 212that four or more of the computed cross matches are similar within thepredetermined threshold, the four or more cross matches that are similarwithin the predetermined threshold are averaged to create an average Rwave snapshot, Step 214, that is then used as the template.

FIG. 5 is a flowchart of generation of a template for an implantablemedical device according to an alternate preferred embodiment of thepresent invention. According to an alternate embodiment of the presentinvention, the automatic template generation process is similar to theprocess described above in reference to FIG. 4, although an additionalstep is included in the alternate embodiment to exclude prematureventricular contractions. In particular, as illustrated in FIG. 5, ifthe beat is determined to be a normal beat, i.e., the beat is neither apaced beat, a beat immediately following a paced beat, or has an R-Rinterval less than 600 ms in Step 204, a determination is made as towhether the R-R interval is greater than a predetermined average R-Rinterval, Step 205. In particular, according to a preferred embodimentof the present invention, a determination is made as to whether the R-Rinterval is greater than approximately 85% of the average R-R interval.However, it is understood that any percentage value could be chosen aslong as the chosen percentage value serves to exclude prematureventricular contractions.

If it is determined in Step 205 that the R-R interval is not greaterthan 85% of the average R-R interval, i.e., the likelihood that the beatis representative of a premature ventricular contraction is great, thebeat is excluded, and the process returns to Step 202 to monitor a nextbeat. On the other hand, if it is determined that the R-R interval isgreater than 85% of the average interval, i.e., it is not likely thatthe beat is representative of a premature ventricular contraction, theprocess continues at Step 208 as described above in FIG. 4. Since thesteps illustrated in FIG. 5, with the exception of Step 205, havepreviously been described above in reference to FIG. 4, description ofthe steps other than Step 205 has not been repeated merely for the sakeof brevity.

While the present invention is described above as computing crossmatches between beats once six beats have been collected, anddetermining whether four of the cross matches exceed the threshold, itis understood that the present invention is not limited to the use ofsix beats and four cross matches, but rather any number of beats andcross matches could be utilized, depending upon the particular patientor device requirements involved.

FIG. 6 is a flowchart of statistical validation of a template for animplantable medical device according to the present invention. Accordingto the present invention, once the average R wave is created in thetemplate generation stage described above for use as the template, thequality of the template is evaluated, based on matches between thetemplate and ongoing slow heart rhythm, which according to a preferredembodiment of the present invention, is chosen as being slower than 100bpm. It is understood that any rate could be chosen as the slow heartrhythm for the statistical validation or creation of the template, andtherefore the invention is not limited to rates slower than 100 bpm.

As illustrated in FIGS. 2 and 6, once the template has been generated,microprocessor 524 sets counters corresponding to the total beat number,the number of matched beats, and the number of bad beats to zero, Step216. Microprocessor then collects one normal beat from every N beats,where N is equal to one hundred, Step 218, and computes a match betweenthe collected beat and the template, Step 220. According to an alternateembodiment of the present invention, in order to reduce current drain,microprocessor 524 collects one beat within a predetermined time period,such as one beat every ten seconds, for example.

A determination is then made as to whether the collected beat matchesthe template within a predetermined threshold, Step 222. For example,according to the present invention, a determination is made as towhether the collected beat matches are nominally within approximately70% of a predetermined threshold. However, the threshold is not limitedto this value, and could be programmed as determined by a physician. Ifthe collected beat does not match the template within the threshold, thebeat is labeled as an unmatched beat, Step 224 and a determination ismade as to whether x out of the last y number of beats have been labeledas unmatched beats, Step 226. If x out of the last y number of beats areunmatched beats, YES in Step 226, the template is determined to beinvalid, Step 232. According to the present invention, once the templatehas been determined to be invalid in Step 232, a determination is madeas to whether a predetermined number of attempts at statisticallyvalidating the template have failed, Step 227. If the predeterminednumber of attempts at statistically validating the template have beenunsuccessful so that statistical validation has failed the predeterminednumber of times, YES in Step 227, the statistical validation process isdelayed for a predetermined period of time, Step 229, thereby reducingcurrent drain on the device 100. Once the statistical validation processhas been delayed for the predetermined time period, the templategeneration process is repeated.

In particular, according to a preferred embodiment of the presentinvention, if it is determined in Step 227 that three attempts atstatistically validating the template have failed, the process isdelayed for approximately nine hours, although it is understood that thepresent invention is not intended to be limited to three attempts inStep 227 or to nine hours in Step 229, but would include any number ofattempts and/or period of delay. On the other hand, if it is determinedin Step 227 that there have not been the predetermined number of failedattempts at statistically validating the template, NO in Step 227, thetemplate generation process is repeated, i.e., the process returns toportion A of FIG. 4 or FIG. 5.

On the other hand, if the collected beat does match the template withinthe threshold, YES in Step 222, the beat is labeled as a matched beat,Step 228. Once the beat is labeled as a matched beat, Step 228, or it isdetermined that x out of the last y number of beats are not unmatchedbeats in Step 226, a determination is made as to whether x′ out of thelast y number of beats are matched beats, Step 230. If x′ out of thelast y number of beats are not matched beats, a determination as made asto whether a predetermined time period has been exceeded, Step 236, sothat if attempts to statistically validate the template are notsuccessful within the predetermined time period of Step 236, thetemplate generation process is repeated, i.e., the process returns toportion A of FIG. 4 or FIG. 5.

However, if it is determined in Step 236 that the predetermined timeperiod has not been exceeded, microprocessor 524 collects another beatand the process is repeated, Step 218. In this way, the statisticalvalidation portion is continued until x′ number of beats are determinedto be matched beats or until x number of beats are determined to beunmatched beats, whichever occurs first, either within y number of beatsor within the time limit. Once x′ out of y number of beats aredetermined to be within the threshold, the template is accepted asvalid, Step 234, and is then copied into the location where the templateis used by microprocessor 524 to perform the morphology discrimination.However, if x out of y number of beats are determined to not be withinthe threshold prior to determining that x′ out of y number of beats arewithin the threshold at Step 222, the process returns to Step A and anew template is generated.

According to a preferred embodiment of the present invention, the xnumber of beats is equal to thirty, the x′ number of beats is equal toseventy, and the y number of beats is equal to one hundred, so that adetermination is made in Step 226 as to whether thirty out of the lastone hundred collected beats are unmatched beats and 230 as to whetherseventy out of the last one hundred collected beats are matched beats inStep 230 of FIG. 6. However, it is understood that, according to thepresent invention, the values for x, x′, and y is not limited to thirty,seventy, and one hundred, respectively. Rather, the present invention isintended to include the use of any number of beats of last collectedbeats to monitor the quality of the template and determine whether thetemplate is valid.

FIG. 7 is a flowchart of monitoring of template quality for animplantable medical device according to the present invention. Asillustrated in FIGS. 2 and 7, once microprocessor 524 determines thatthe template is validated (Step C in FIG. 6), microprocessor 524 setscounters corresponding to the total number of beats, the number ofevaluated beats, the number of matched beats, and the number of badbeats to zero, Step 236. Microprocessor 524 then collects one normalbeat from every N beats, where N is equal to one thousand, Step 238, andcomputes a match between the beat and the template, Step 240. Accordingto an alternative embodiment of the present invention, microprocessor524 collects one normal beat within a predetermined time period, forexample one normal beat is collected approximately every one thousandseconds.

Once the match between the beat and the template is computed,microprocessor 524 determines whether the collected beat matches thetemplate within a predetermined threshold, Step 242. If the collectedbeat does not match the template within the threshold, the beat islabeled as a bad, or unmatched beat, Step 244 and a determination ismade as to whether x out of the last y number of beats are unmatchedbeats, Step 246. If x out of the last y number of beats are unmatchedbeats, the template is determined to be invalid, and the templategeneration process is repeated, i.e., the process returns to portion Aof FIG. 4. On the other hand, if x of the last y number of beats are notunmatched beats in Step 246, another normal, regular beat from onethousand beats is collected, Step 238 and the process is repeated.

If the collected beat does match the template within the threshold, YESin Step 242, the beat is labeled as a good, or matched beat, Step 248,and the determination is made at Step 246 as to whether x of the last ynumber of beats are unmatched beats. If x out of the last y number ofbeats are unmatched beats, the template is determined to be invalid, andthe template generation process is repeated, i.e., the process returnsto portion A of FIG. 4. On the other hand, if x of the last y number ofbeats are not unmatched beats in Step 246, another regular beat from onethousand beats is collected, Step 238 and the process is repeated.

According to a preferred embodiment of the present invention, the xnumber of beats is equal to thirty and the y number of beats is equal toone hundred, so that a determination is made in Step 246 as to whetherthirty out of the last one hundred collected beats are unmatched beats.However, it is understood that, according to the present invention, thevalues for x and y is not limited to thirty and one hundred,respectively. Rather, the present invention is intended to include theuse of any number of beats of last collected beats to monitor thequality of the template and determine whether the template is valid.

In this way, the monitoring stage of the present invention, illustratedin FIG. 6, is similar to the statistical validation of the templatestage, illustrated in FIG. 7, with the exception that one out of everyone thousand beats are evaluated and once more than thirty out of thelast one hundred beats do not match the template within the threshold,an attempt is made to create a new template, Step A of FIG. 4. Inaddition, the monitoring stage is continuous unless x out of the last ybeats are determined to be unmatched beats in Step 246, i.e., thetemplate is invalid, in which case the process returns to portion A ofFIG. 4 to re-generate the template. While the characteristic time forthe monitoring stage of FIG. 7 is approximately 20-30 hours, if there isa change in the EGM morphology, the change will be picked up by thepresent invention in approximately one-third of this characteristic time(i.e., 7-10 hours), since it only takes 30 mismatches to reject thetemplate.

FIG. 8 is a flowchart of monitoring of template quality for animplantable medical device according to an alternate embodiment of thepresent invention. As illustrated in FIG. 8, an alternate embodiment ofthe template monitoring process according to the present invention issimilar to the template monitoring process described above in referenceto FIG. 7, and therefore description of Steps 236-246 of FIG. 8 isomitted merely for brevity sake. However, the alternate embodiment ofFIG. 8 differs from the embodiment described above in reference to FIG.7 in that if x out of the last y number of beats are determined to beunmatched beats in Step 246, a determination is then made as to whetheran average degree of similarity between the unmatched beats (x in step246) and the template is less than a predetermined threshold, Step 248,such as a fraction of the threshold used to label beats as matched orunmatched in Step 242. If the average degree of similarity between theunmatched beats and the template is less than the predeterminedthreshold, YES in Step 248, the template currently copied in thepermanent position is deleted, Step 250, the process returns to Step 160to create a new template. On the other hand, if the average degree ofsimilarity between the unmatched beats and the template is greater thanor equal to the predetermined threshold, NO in Step 248, the templatecurrently copied in the permanent position is not deleted and theprocess returns to Step 160 to create a new template.

According to a preferred embodiment of the present invention, thethreshold used in Step 248 is selected as 50% of the threshold utilizedin Step 242, although it is understood that any threshold could beutilized in accordance with the present invention that identifies thenecessity to delete the current template prior to attempting to create anew template.

It is understood that while the present invention has been describedabove as validating a template once seventy matched beats have beencollected and invalidating the template once thirty collected beats donot match the template within a threshold, the present invention is notintended to be limited to requiring seventy out of one hundred beats tomatch the template within the threshold in order for the template to bedetermined to be statistically valid. Rather, any number of beats couldbe utilized in the statistical evaluation. Similarly, while the presentinvention has been described above as monitoring the quality of thetemplate once seventy matched beats have been collected out of onehundred beats over a total of one thousand beats, and invalidating thetemplate once thirty out of the last one hundred collected beats do notmatch the template within a threshold, any number of beats could beutilized in the monitoring of the quality of the template.

It is further understood that while the present invention has beendescribed in terms of its application to a single chamber system in FIG.1, the present invention is not intended to be limited to such singlechamber systems, but rather can be utilized in other systems, such asthe dual chamber system described, for example, in U.S. Pat. No.6,141,581 issued to Olson et al, on Oct. 31, 2000, incorporated hereinby reference in its entirety.

It is understood that according to the present invention, a “normal”beat is described as a beat that is not a paced beat, not a beatimmediately following a paced beat, not a beat with an R-R interval lessthan a predetermined maximum rate (i.e., 600 ms or VT detection interval(TDI)+60), and optionally as a beat that is not associated with apremature ventricular contraction, i.e., a beat having an R-R intervalgreater than a certain percentage of an average R-R interval, such as0.85R-R for example.

In addition, the present invention includes a set of criteria forinterrupting or further delaying the template creation, validation andquality monitoring (steps 162, 164, and 170 in FIG. 3) during a timeperiod when the intracardiac EGM signal may be unstable due to recentanti-tachycardia therapy or tachyarrhythmia events.

For example, according to the present invention, if a tachycardiaepisode (including VT monitor episode) occurs, or if a clinicianinitiates a device programming change that may effect the EGM signal(for example, delivery of tachyarrhythmia therapy, induction of atachyarrhythmia event) any of the template processes will be stopped fora programmable period of time, such as 1 hour for example. If thetemplate creation process was ongoing, the collected samples (FIG. 208in FIG. 4) will be cleared and the template creation process will startover (A in FIG. 4) after the programmable period of time expires.Template validation and template creation processes will be suspended(counters are not cleared) for the programmable duration. If theclinician initiates a device programming changes that changes the EGMsignal characteristics (e.g. signal vector, signal gain, signalfiltering), the current template will be deleted. Once the currenttemplate is deleted after a physician initiated EGM signal change, thetemplate creation process will be restarted with or without a delay of aprogrammable period of time.

Finally, it is understood that while the beats that are collected inStep 238 of FIG. 7 and Step 218 of FIG. 6, are described as being oneout of one thousand and one out of one hundred, respectively, thepresent invention is not intended to be limited to those counts, butrather may utilize any number of counts, dependent upon physician and/orsystem requirements.

The preceding specific embodiments are illustrative of the practice ofthe invention. It is to be understood, therefore, that other expedientsknown to those of skill in the art or disclosed herein may be employed.In the following claims, means-plus-function clauses are intended tocover the structures described herein as performing the recited functionand not only structural equivalents but also equivalent structures. Forexample, although a nail and a screw may not be structural equivalentsin that a nail employs a cylindrical surface to secure wooden partstogether, whereas a screw employs a helical surface, in the environmentof fastening wooden parts, a nail and a screw are equivalent structures.It is therefore to be understood, that within the scope of the appendedclaims, the invention may be practiced otherwise than as specificallydescribed without actually departing from the spirit and scope of thepresent invention.

1. A method of generating a template in an implantable medical devicefor implantation within a patient, comprising the steps of: generating atemplate from collected events corresponding to the patient; delayingthe step of generating a template for a first predetermined time periodin response to the template not being generated within a predeterminednumber of collected events; determining whether the template is valid;and monitoring the template to determine whether the template is anaccurate representation of the patient.
 2. The method of claim 1,wherein the first predetermined time period is approximately 10 minutesand the predetermined number of collected events is
 64. 3. The method ofclaim 1, further comprising the steps of: generating a new template inresponse to the template not being an accurate representation; andcontinuing to monitor the template in response to the template being anaccurate representation.
 4. The method of claim 1, wherein the step ofgenerating a template comprises the steps of: monitoring a heart rate ofthe patient to generate the collected events; determining whether beatscorresponding to the collected events are normal beats; and determiningwhether a predetermined number of normal beats has been collected withinthe predetermined number of collected events.
 5. The method of claim 4,wherein the step of delaying the template generation includes delayingthe template generation in response to the predetermined number ofnormal beats not being collected within the predetermined number ofcollected events.
 6. The method of claim 5, wherein the step ofgenerating a template further comprises: determining whether thepredetermined number of normal beats have been collected and computingcross matches between the predetermined number of collected normal beatsto form corresponding computed cross matches; determining whether apredetermined number of the computed cross matches exceed a threshold;determining whether a predetermined number of cross matching attemptshave failed; delaying the template generation for a second predeterminedtime period in response to the predetermined number of failed crossmatching attempts; and forming the template from the predeterminednumber of computed cross matches in response to the predetermined numberof the computed cross matches exceeding the threshold.
 7. The method ofclaim 6, wherein the predetermined number of cross matches is four andthe second predetermined time period is approximately equal to 156minutes.
 8. The method of claim 4, wherein the step of determiningwhether beats corresponding to the collected events are normal beatsincludes excluding beats having R-R intervals greater than apredetermined R-R interval.
 9. The method of claim 8, wherein thepredetermined R-R interval is approximately 85% of an average R-Rinterval.
 10. The method of claim 6, wherein the predetermined number ofbeats is six and the predetermined number of computed cross matches isfour.
 11. The method of claim 1, wherein the step of determining whetherthe template is valid comprises the steps of: collecting subsequentnormal beats within a second predetermined time period; computing amatch between the subsequently collected normal beats and the template;determining whether the match is within a predetermined threshold toform matched beats and other than matched beats; determining whether theother than matched beats is greater than a first number of beats; anddetermining the template is valid in response to the matched beats beinggreater than or equal to a second number of beats.
 12. The method ofclaim 11, wherein the step of collecting subsequent normal beatscomprises collecting one normal beat within 10 seconds.
 13. The methodof claim 11, wherein, in response to the other than matched beats beinggreater than the first number of beats, the step of determining whetherthe template is valid further comprises the step of: determining whetherattempts to validate the template have failed a predetermined number oftimes; repeating the step of generating a template in response tovalidation of the template not having failed the predetermined number oftimes; and delaying the step of determining whether the template isvalid for a third predetermined time period in response to validation ofthe template having failed the predetermined number of times.
 14. Themethod of claim 13, wherein the third predetermined time period isapproximately equal to 9 hours and the predetermined number of times isthree.
 15. The method of claim 11, wherein the first number of beats isthirty and the second number of beats is seventy.
 16. The method ofclaim 11, further comprising, in response to the matched beats not beinggreater than or equal to the second number of beats, the steps of:determining whether a match has been computed for a predetermined numberof beats; determining whether a time period has been exceeded inresponse to the match not being computed for the predetermined number ofbeats; and repeating the step of generating a template in response tothe predetermined time period being exceeded.
 17. The method of claim16, wherein the first number of beats is thirty, the second number ofbeats is seventy, and the predetermined number of beats is one hundred.18. The method of claim 1, wherein the step of monitoring the templatecomprises the steps of: (a) collecting subsequent normal beats within asecond predetermined time period; (b) computing a match between asubsequently collected beat and the template; (c) determining whetherthe match is within a predetermined threshold to form matched beats andother than matched beats; (d) determining whether x out of the last ysubsequently collected beats are other than matched beats; and (e)repeating steps (a)-(d) in response to x out of the last y beats notbeing other than matched beats.
 19. The method of claim 18, wherein step(a) comprises collecting one normal beat every 1000 seconds.
 20. Themethod of claim 18, wherein the step of computing a match comprisescomputing the match for one out of every one thousand subsequentlycollected beats and the template
 21. The method of claim 18, furthercomprising the step of repeating the step of generating a template inresponse to x out of the last y beats being other than matched beats.22. The method of claim 18, further comprising, in response to x out ofthe last y beats being other than matched beats, the steps of:determining whether an average degree of similarity between the otherthan matched beats and the template is less than a predeterminedthreshold; deleting the template in response to the average degree ofsimilarity between the other than matched beats and the template beingless than the predetermined threshold; and generating a template inresponse to the average degree of similarity between the other thanmatched beats and the template being greater than or equal to thepredetermined threshold.
 23. The method of claim 18, wherein x is thirtyand y is one hundred.
 24. A processor readable medium in an implantablemedical device, comprising: means for collecting events corresponding tothe patient; and means for generating a template corresponding from thecollected events, the means for generating a template further delayingthe template generation for a first predetermined time period inresponse to the template not being generated within a predeterminednumber of the collected events, determining whether the template isvalid and monitoring the template to determine whether the template isan accurate representation of the supraventricular rhythm.
 25. Theprocessor readable medium of claim 24, wherein the generating meansgenerates a new template in response to the template not being anaccurate representation; and continues to monitor the template inresponse to the template being an accurate representation
 26. Theprocessor readable medium of claim 24, wherein the generating meansmonitors a heart rate of the patient to generate the collected events,determines whether beats corresponding to the collected events arenormal beats, and determines whether a predetermined number of normalbeats has been collected within the predetermined number of collectedevents.
 27. The processor readable medium of claim 24, wherein thegenerating means determines whether a predetermined number of normalbeats have been collected and computes cross matches between thepredetermined number of collected normal beats to form correspondingcomputed cross matches, determines whether a predetermined number of thecomputed cross matches exceed a threshold, determines whether apredetermined number of cross matching attempts have failed, delays thetemplate generation for a second predetermined time period in responseto the predetermined number of failed cross matching attempts, and formsthe template from the predetermined number of computed cross matches inresponse to the predetermined number of the computed cross matchesexceeding the threshold.
 28. The processor readable medium of claim 24,wherein the generating means determines whether attempts to validate thetemplate have failed a predetermined number of times, generates a new atemplate in response to validation of the template not having failed thepredetermined number of times, and delays determination of whether thetemplate is valid for a second predetermined time period in response tovalidation of the template having failed the predetermined number oftimes
 29. The processor readable medium of claim 24, wherein thegenerating means determines whether an average degree of similaritybetween the other than matched beats and the template is less than apredetermined threshold, deletes the template in response to the averagedegree of similarity between the other than matched beats and thetemplate being less than the predetermined threshold, and generates atemplate in response to the average degree of similarity between theother than matched beats and the template being greater than or equal tothe predetermined threshold.